import chardet

with open("wen.csv", "rb") as f:
    result = chardet.detect(f.read())
    print("Detected encoding:", result['encoding'])